﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.IO;

namespace WAPA.Framework
{
    public static class ProcessStarter
    {
        public static void RunSilentProcess(string executableFile, string arguments)
        {
            ProcessStartInfo psi = new ProcessStartInfo();
            psi.FileName = executableFile;
            psi.Arguments = arguments;
            psi.CreateNoWindow = false;
            psi.ErrorDialog = false;
            psi.UseShellExecute = true;
            psi.WindowStyle = ProcessWindowStyle.Normal;
            psi.RedirectStandardOutput = false;
            psi.RedirectStandardError = false;

           
            // Start the process with the info we specified.
            // Call WaitForExit and then the using statement will close.
            using (Process exeProcess = Process.Start(psi))
            {
                exeProcess.WaitForExit();
            }
        }
    }
}
